﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CuaHangLaptop.DAL;

namespace CuaHangLaptop.BIZ
{
    public class NhaSX_BIZ
    {
        int id;
        string maNSX;
        string tenNSX;

        public int ID
        {
            get { return id; }
            set { id = value; }
        }

        public string MaNSX
        {
            get { return maNSX; }
            set { maNSX = value; }
        }        

        public string TenNSX
        {
            get { return tenNSX; }
            set { tenNSX = value; }
        }

        public NhaSX_BIZ()
        {
        }        

        public NhaSX_BIZ(int _id, string mansx, string tennsx)
        {
            id = _id;
            maNSX = mansx;
            tenNSX = tennsx;
        }

        public NhaSX_BIZ Get_NSX_ByCode(string _MaNSX)
        {
            return NhaSX_DAL.Get_NSX_ByCode(_MaNSX);
        }

        public List<NhaSX_BIZ> GetAll_NSX()
        {
            return NhaSX_DAL.GetAll_NSX();
        }

        public void Save()
        {
            if (id == -1) id = NhaSX_DAL.Insert(this);
            else NhaSX_DAL.Update(this);
        }

        public void Delete()
        {
            NhaSX_DAL.Delete(this);
        }
    }
}
